package aloyii.demo3.before;

/**
 * @Author yajing zhu
 * @Date 2024/10/25 14:59
 * @Version 1.0
 * @注释：
 */
public class ComputerDemo {
    public static void main(String[] args) {
        //创建组件对象
        XiJieHardDisk hardDisk = new XiJieHardDisk();
        IntelCpu cpu = new IntelCpu();
        KingstonMemory memory = new KingstonMemory();
        
        //创建计算机对象
        Computer computer = new Computer();
        //调用计算机的功能
        computer.setCpu(cpu);
        computer.setHardDisk(hardDisk);
        computer.setMemory(memory);
        
        //运行计算机
        computer.run();
    }
}
